<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<title>hr-m-s</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/style.css" >
</head>
<body>
<form id="authority_group_add" name="authority_group_add" method="post" action="authorityGroup!add">
  <table width="900" border="1" cellpadding="0" cellspacing="0" align="center">
    <tr>
      <th colspan="4" scope="col">添加新权限组</th>
    </tr>
    <tr>
      <td width="80">组名</td>
      <td width="720" colspan="2">
        <input name="authorityGroupName" type="text" id="authorityGroupName" size="50" maxlength="50" />
      </td>
      <td width="100">权限组名称</td>
    </tr>
    <tr>
      <td rowspan='<s:property value="parentMenuVO.size() + 1"/>'>权限</td>
      <td colspan="2">勾选复选框分配权限</td>
      <td rowspan='<s:property value="parentMenuVO.size() + 1"/>'>请合理分配权限</td>
    </tr>
	  <s:iterator value="parentMenuVO" var="pm">
		  <tr>
	      	<td width="80"><s:property value="parentMenuName"/></td>
	        <td width="640">&nbsp;
	          <s:iterator value="childMenus" var="cm">
			    <input type="checkbox" id="privilegeList" name="privilegeList" value='<s:property value="#pm.parentMenuID"/>,<s:property value="childMenuID"/>' />
			    <s:property value="childMenuName"/>
			  </s:iterator>
	        </td>
	      </tr>
	  </s:iterator>
    <tr>
      <td>是否启用</td>
      <td colspan="2">
        <select name="authorityGroupDisplayKey" id="authorityGroupDisplayKey">
          <option value="1">启用</option>
          <option value="0">停用</option>
        </select></td>
      <td>用于控制显示</td>
    </tr>
    <tr>
      <td colspan="4">
        <input type="submit" name="Submit" value="添加" onclick="return checkForm();" />
		<input type="reset" name="Reset" value="重置" onclick="javascript:return confirm('确定要重新填写部门信息吗？');" />
	  </td>
    </tr>
  </table>
</form>
<script type="text/javascript">
	function checkForm(){
		var name = document.getElementById("authorityGroupName");
		if (name.value == ""){
			alert("请输入权限组名称！");
			name.focus();
			return false;
		}
		return true;
	}
</script>
</body>
</html>
